<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title> {$detail['title']} </title>
    {php echo register_jssdk(false);}
    <link rel="stylesheet" type="text/css" href="{RES}css/page_mp_article_improve24f185.css">
    <link rel="stylesheet" type="text/css" href="{RES}css/page_mp_article_improve_combo24f185.css">
    <!--[if lt IE 9]>
    <link rel="stylesheet" type="text/css"
          href="http://res.wx.qq.com/mmbizwap/zh_CN/htmledition/style/page/appmsg/page_mp_article_improve_pc24ed02.css">
    <![endif]-->
</head>
<body id="activity-detail" class="zh_CN " ontouchstart="">
<div id="js_article" class="rich_media">
    <div id="js_top_ad_area" class="top_banner"></div>
    <div class="rich_media_inner">
        <div id="page-content">
            <div id="img-content" class="rich_media_area_primary"><h2 class="rich_media_title" id="activity-name">
                {$detail['title']}
            </h2>

                <div class="rich_media_meta_list">
                    <em id="post-date" class="rich_media_meta rich_media_meta_text">
                        {php echo date('Y-m-d', $detail['createtime'])}
                    </em>
                    <a class="rich_media_meta rich_media_meta_link rich_media_meta_nickname" href="{$set['guanzhuUrl']}">
                        {$_W['account']['name']}
                    </a>
                    <span  class="rich_media_meta rich_media_meta_text rich_media_meta_nickname">{$account['name']}</span>

                    <div id="js_profile_qrcode" class="profile_container" style="display:none;">
                        <div class="profile_inner"><strong class="profile_nickname">{$account['name']}</strong>
                            <img class="profile_avatar" src="{php echo tomedia('qrcode_'.$account['acid'].'.jpg');}?time={php echo time()}" alt="">

                            <p class="profile_meta"><label class="profile_meta_label">微信号</label> <span
                                    class="profile_meta_value">{$account['account']}</span></p>

                            <p class="profile_meta"><label class="profile_meta_label">功能介绍</label> <span
                                    class="profile_meta_value">{$account['description']}</span>
                            </p></div>
                    <span class="profile_arrow_wrp" id="js_profile_arrow_wrp">
                        <i class="profile_arrow arrow_out"></i>
                        <i class="profile_arrow arrow_in"></i>
                    </span>
                    </div>
                </div>
                <div class="rich_media_content" id="js_content">
                    {$detail['content']}
                </div>
                {if $detail['isadmire']==0}
                {if $isMobile}
                    {template 'include_zanshang'}
                {/if}
                {/if}

                <div class="rich_media_tool" id="js_toobar">
                    {if $detail['outLink']}<a class="media_tool_meta meta_primary"  href="{$detail['outLink']}">阅读原文</a>{/if}

                    <div class="media_tool_meta tips_global meta_primary">阅读
                        <span id="readNum">{if $detail['clickNum']>=100000}100000+{else}{$detail['clickNum']}{/if}</span>
                    </div>

                <span class="media_tool_meta meta_primary" id="like3"  like="0">
                    <i class="icon_praise_gray" id="icon_parise"></i><span class="praise_num" id="likeNum3">
                    {if $detail['zanNum']>=100000}100000+{else}{$detail['zanNum']}{/if}</span>
                </span>
                    {if $detail['tel']}<a href="tel:{$detail['tel']}" >一键拨号</a>{/if}
                    <a id="" class="media_tool_meta tips_global meta_extra" href="{php echo $this->createMobileUrl('jubao')}">举报</a></div>
            </div>

            <div class="rich_media_area_extra">
                <div class="mpda_bottom_container" id="js_bottom_ad_area"></div>
                <div id="js_iframetest" style="display:none;"></div>
            </div>

            {if $detail && $detail['iscomment']=='0'}
            {if $isMobile}
            {template 'include_comment'}
            {/if}
            {/if}
        </div>
        <div id="js_pc_qr_code" class="qr_code_pc_outer" style="display:none;">
            <div class="qr_code_pc_inner">
                <div class="qr_code_pc">
                    <img src="{php echo tomedia('qrcode_'.$account['acid'].'.jpg');}?time={php echo time()}" class="qr_code_pc_img">
                    <p>微信扫一扫<br>关注该公众号</p>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var uin = "";
    var key = "";
    var pass_ticket = "";
    //全局变量
    gSound = '{$detail['musicurl']}';
</script>
<script type="text/javascript">var _speedMark = new Date(), _loadTime = '1429101314';</script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"  charset="utf-8"></script>
<script type="text/javascript" src="{RES}js/weixin_new.js"></script>
<div id='audiocontainer'></div>

{template 'rec_adv'}

</div>

<!--<div style=' position:fixed;left:0; bottom:0px; right:0px;width:100%; background:#4F2D2D; height:30px; line-height:35px; font-family: 微软雅黑'>
<div align='center' style='height:35px; line-height:30px;background:#4F2D2D; color:#fff; display:block; '>
    <a href="{$set['historyUrl']}"  style='color:#fff;font-size:16px;'>历史消息</a>
    <span  style='color:#fd6b6b; margin:0 15px'>|</span>
    <a href="{php echo $this->createMobileUrl('index', array('weid' => $_W['acid']),true)}" style='color:#fff;font-size:16px;'>经典回顾</a>
    <span  style='color:#fd6b6b; margin:0 15px'>|</span>

    <a href="{$set['guanzhuUrl']}"  style='color:#fff;font-size:16px; '>
    {if !empty($set['guanzhutitle'])}{$set['guanzhutitle']}{else}免费订阅{/if}
    </a>
</div>
</div>-->
<!--{if !empty($set['cnzz'])}
{php echo htmlspecialchars_decode($set['cnzz']);}
{/if}-->
</div>
<!--js部分-->
<script>
    $(function(){
        var el_toolbar = document.getElementById("js_toobar");
        if (el_toolbar && el_toolbar.querySelector) {
            var el_like = el_toolbar.querySelector("#like3"), el_likeNum = el_toolbar.querySelector("#likeNum3"), el_readNum = el_toolbar.querySelector("#readNum3");

            var tmpAttr = el_like.getAttribute("like"), tmpHtml = el_likeNum.innerHTML, isLike = parseInt(tmpAttr) ? parseInt(tmpAttr) : 0, like = isLike ? 0 : 1, likeNum = parseInt(tmpHtml) ? parseInt(tmpHtml) : 0;

            $("#like3").click(function() {
                var id="{$detail['id']}";

                var ajaxurl="{php echo $_W['siteroot'].'app/'.murl('entry//like',array('m'=>'amouse_article'),true)}";
                like = isLike ? 0 : 1 ;
                $.ajax({
                    url: ajaxurl,
                    type: "post",
                    dataType: "json",
                    data: {"articleid": id,"like":like},
                    success: function (res) {
                        console.log(res);
                        var menu = $("#icon_parise");
                        0 == res.ret && (isLike ? (menu.removeClass("praised"), el_like.setAttribute("like", 0),
                        likeNum > 0 && "100000+" !== tmpHtml && (el_likeNum.innerHTML = likeNum - 1 == 0 ? "赞" : likeNum - 1)) : (el_like.setAttribute("like", 1),
                                menu.addClass("praised"), "100000+" !== tmpHtml && (el_likeNum.innerHTML = likeNum + 1)));

                    },
                    error: function (r) {
                        console.log(r);
                    }
                });

            });
        }
    });

    initShare();
    function initShare(){
        wx.ready(function () {
            shareMeta = {
                imgUrl:"{$shareimg}",
                link :  "{$url}",
                desc : "{$detail['title']}",
                title : "{$detail['title']}",
                success: function(){

                },
                cancel: function(){
                    // alert("分享失败，可能是网络问题，一会儿再试试？");
                }
            };
            wx.onMenuShareTimeline(shareMeta);
            wx.onMenuShareAppMessage(shareMeta);
            wx.onMenuShareWeibo(shareMeta);
            wx.onMenuShareQQ(shareMeta);
            wx.onMenuShareQZone(shareMeta);
        });
    }


    $("#comment_praise").click(function() {
        var d = {};
        d['commentid'] =$(this).parent().attr("contentid");
        $.ajax({
            url: "{php echo $_W['siteroot'].'app/'.murl('entry//ajaxpraise',array('m'=>'amouse_article'),true)}",
            type: "post",
            data : d,
            dataType: "json",
            success: function (res) {
                console.log(res);
                if(res && res.code ===200){
                    location.reload(true);
                }else{

                }
            },
            error: function (r) {
                console.log(r);
            }
        });
    });
</script>


</body>
</html>